<template>
    <div class="p20">
        <ui-title>反馈建议</ui-title>
        <el-input v-model="msg" type="textarea" placeholder="你的宝贵建议是打开我们前行明灯" :rows="7" style="width:500px;"></el-input>
        <el-button @click="submit" type="primary" class="ui-button-large mt10 block">提交</el-button>
        <div class="mt20 f-color-grey">我们将直接回复到站内信，请注意查收。</div>
    </div>
</template>
<script>
    export default {
        data(){
            return {
                title: this.$store.state.userInfo.user_login + ' 的留言',
                msg:''
            }
        },
        methods:{
            submit(){
                this.$http.post('index.php?g=home&m=GuestBook&a=add_msg',{
                    msg:this.msg,
                    title:this.title
                })
                .then(({data})=>{
                    console.log('反馈', data)
                    this.$message(data.msg)
                    if (data.code===1) {
                        this.msg = ''
                    }
                })
            }
        },
    }
</script>